//
//  CommonConfigUtil.h
//  ihotels
//
//  Created by admin on 11-9-19.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "iToast.h"

 


@class CATransition;


@interface CommonConfigUtil : NSObject {
    
   
}
+(void)writeJsonToLocal:(NSDictionary*)dict localFile:(NSString*)localFile;
//原图URL前缀
+(NSString*) getTongChenBigImageUrl;
//图片url前缀
+(NSString*) getTongChenImageBaseUrl;
//同程景点预订url
+(NSString*) getTongChenSceneryOrderUrl;

+(NSString*)getGaoDeMapKey;
//是否显示广告
+ (NSString *) getShowadv;


+ (NSString *) getHomeDataFilePath;

+ (NSString *) getCoverId;


+ (NSString *) getCoverName;

//应用接口地址
+ (NSString *) getCoverUrl;

//取得封面配置信息，主要为了取得directLink：1：直接跳转到淘宝页面，0：跳转到详细页面
+(void)getCoverInfo;

//取得directLink：1：直接跳转到淘宝页面，0：跳转到详细页面
+(BOOL) checkDirectLink;



+ (int) get91AppId;

+ (NSString *) get91AppKey;

+ (NSString *) getUmengAppKey;
	
+ (NSString *)  getChannelId;
    
//TTID
+ (NSString *) getTaobaoTTID;

//客户端版本
+ (NSString *) getMobileClientApp;

//接口地址
+ (NSString *) getInfServiceUrl;



+ (NSString *) getApp;
    
//当前版本
+ (NSString *) getCurrVersion;

//版本name
+ (NSString *) getVersionName;



//版本类型 0:iphone 1:ipad 2:andorid
+(NSString *)getVersionType;

//应用推荐类型 0:iphone 1:ipad 2:andorid
+(NSString *)getAppAdvType;


+(NSString*) getAppStoreUrl;

//评分地址
+(NSString*) getAppStoreCommentUrl;

+(BOOL)checkVersion;

//ios device info split with &
+(NSString*) getDeviceInfo;



+ (void)showToast:(ToastPosition)position withTitle:(NSString *)title;

+(NSString *)getSinaWeiboAppKey;


+(NSString *)getSinaWeiboAppSecret;

+(NSString *)getSinaWeiboWebPath;

+(NSString *)getQQWebPath;


+(NSString *)getQQAppID;


+(NSString *)getUserRegSource;

//检查网络
+(BOOL)checkNetworkReachable; 

//写入图片到本地
+(BOOL)writeImage:(NSString*)imageUrl toImagePath:(NSString*) imagePath;

+ (void) setImageFromUrl:(NSString*)urlString toImagePath:(NSString*) imagePath;
+ (void) setImageFromUrl:(NSString*)urlString toImagePath:(NSString*) imagePath
              completion:(void (^)(void))completion;

//图片网络路径
+ (NSString *) getImageNetPath;

//商品图片网络路径
+ (NSString *) getSubjectImageNetPath;

//age图片网络路径
+ (NSString *) getAgeImageNetPath;

//商品图片网络路径
+ (NSString *) getSubjectDescImageNetPath;

//图片本地路径
+ (NSString *) getImageLocalPath;

+ (NSString *) getFileLocalPath;

//用户图片网络路径
+ (NSString *) getUserImageNetPath;


//广告图片网络路径
+ (NSString *) getAdvImageNetPath;


//品牌图片网络路径
+ (NSString *) getBrandImageNetPath;

//专辑图片网络路径
+ (NSString *) getAlbumImageNetPath;

//shop图片网络路径
+ (NSString *) getShopImageNetPath;


//通过表情图片名字得到本地表情图片
+(UIImage *)getLocalFaceWithImageName:(NSString *)faceImageName;

//通过网络表情图片名字得到本地表情图片
+(UIImage *)getLocalFaceWithNetImage:(NSString *)faceImageName;

//通过产品ID得到大图本地路径
+ (NSString *) getBigImagePathWithProdId:(NSString *)prodId;

//通过产品ID得到大图
+ (UIImage *) getBigImageWithProdId:(NSString *)prodId;


//通过产品ID得到小图本地路径
+ (NSString *) getSmallImagePathWithProdId:(NSString *)prodId;

//文件是否存在
+ (BOOL )  existSmallImageWithProdId:(NSString *)prodId;
    
//通过产品ID得到小图
+ (UIImage *) getSmallImageWithProdId:(NSString *)prodId;

//通过产品ID得到width 600本地路径
+ (NSString *) getImagePath600WithProdId:(NSString *)prodId;

//通过产品ID得到width 600图
+ (UIImage *) getImage600WithProdId:(NSString *)prodId;
    //文件是否存在


//通过产品ID得到小图height205本地路径
+ (NSString *) getImagePath205WithProdId:(NSString *)prodId;

//通过产品ID得到小图height205
+ (UIImage *) getImage205WithProdId:(NSString *)prodId;

//通过产品ID得到小图height100本地路径
+ (NSString *) getImagePath100WithProdId:(NSString *)prodId;

//通过产品ID得到小图height100
+ (UIImage *) getImage100WithProdId:(NSString *)prodId;


//通过图片ID得到width600本地路径
+ (NSString *) getImagePath600WithImageId:(NSString *)imageId;

//通过图片ID得到图width600
+ (UIImage *) getImage600WithImageId:(NSString *)imageId;



//通过用户ID得到用户头像50*50本地路径
+ (NSString *) getUserSmallImagePathWithUserId:(NSString *)userId;

//通过用户ID得到用户头像50*50
+(UIImage *) getUserSmallImageWithUserId:(NSString *)userId;

//通过用户ID得到用户头像本地路径
+ (NSString *) getUserBigImagePathWithUserId:(NSString *)userId;

//通过用户ID得到用户头像
+(UIImage *) getUserBigImageWithUserId:(NSString *)userId;


//通过shop ID得到shop logo本地路径
+ (NSString *) getShopLogoImagePathWithShopId:(NSString *)shopId;

//通过shop ID得到shop logo
+(UIImage *) getShopLogoImageWithShopId:(NSString *)shopId;

//get animation
+(CATransition *) getCATransitionWithType:(NSString *)trantype subtype:(NSString *)subtype;

//+(void)setAnimationWithType:(NSInteger *)trantype forView:(UIView *)trantView;

+ (BOOL) existImageWithLocalPath:(NSString *)LocalPath;
+ (BOOL) existFileWithLocalPath:(NSString *)LocalPath;
//通过path得到图
+ (UIImage *) getImageWithLocalPath:(NSString *)LocalPath;

+ (void)advAppUrlParseWithAppUrl:(NSString *) appurl withUrlparams:(NSString *) urlparams withUINavigationController:(UINavigationController *)navigationController;

+ (void)advSelectWithParams:(NSDictionary *) params withNavController:(UIViewController *)naviController;

+ (void)advSelectWithParams:(NSDictionary *) params withUINavigationController:(UINavigationController *)navigationController;


//手机操作统计
+ (void) saveMobileStat:(NSDictionary *)params;


+(NSInteger)getRoladDataTimeSecond; 



//sina weibo,qq share
+ (void) weiboShare:(NSDictionary *)params;




@end
